<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
  <script src="https://unpkg.com/fabric@4.6.0/dist/fabric.min.js"></script>
</head>
<body>
  <!-- <img src="https://img1.baidu.com/it/u=3206351602,2714439067&fm=253&fmt=auto&app=138&f=JPEG?w=800&h=500" alt=""> -->
  <!-- <img src="./assets/imgs/Snipaste_2022-10-25_11-11-58.png" alt=""> -->
  <canvas width="400" height="400" id="canvas" style="border: 1px solid #ccc;"></canvas>
  <script>
    // 绘制一个 canvas
    const canvas = new fabric.Canvas('canvas')

    // 创建一个圆
    canvas.add(
      new fabric.Circle(
        {
          radius: 30, // 圆的半径
          fill: '#f55',
          top: 70,
          left: 70
        }
      )
    )
    
    // 设置覆盖图像的画布
    canvas.setOverlayImage( // setOverlayImage(image, callback, optionsopt)
      './assets/imgs/jail_cell_bars.png',
      canvas.renderAll.bind(canvas),
      {
        top: 10
      }
    )

  </script>
</body>
</html>